{include file="public/header" /}
<body style="font-size:16px;">
	<div class="container" id="newList">
		
	</div>
	<script type="text/javascript">
		var page = 1;
		list();
		$(window).scroll(function(){
			if($(window).scrollTop() == $(document).height() - $(window).height()){
				list();
			}
		});
		function list(){
			$.post("/index.php/index/my/course_json",{page:page},function(res){
				var list = '';
				if(res.code == 0){
					var list_length = res.data.length;
					for(var i=0;i<res.data.length;i++){
						list += '<div class="clearfix" style="padding-top:15px;padding-bottom:15px;" onclick="go_url(\'/index.php/index/index/details?id='+res.data[i].id+'\')">';
						list += '	<div>';
						list += '		<div class="col-xs-9">';
						list += '			<span style="font-size:20px;">'+res.data[i].title+'</span>';
						list += '		</div>';
						list += '		<div class="col-xs-3 text-right text-danger" style="margin-top:4px;">';
						if(res.data[i].tuition == 0){
							list += '			<span style="font-size:12px;">免费</span>';
						}else{
							list += '			<span style="font-size:12px;">￥'+res.data[i].class.tuition+'</span>';
						}
						list += '		</div>';
						list += '		<div class="col-xs-12">';
						list += '			<span>老师：'+res.data[i].teacher_name+'</span>';
						list += '		</div>';
						list += '		<div class="col-xs-12">';
						list += '			<span>老师电话：'+res.data[i].teacher_phone+'</span>';
						list += '			<button type="button" class="btn btn-success" onclick="go_url(\'/index.php/index/my/course_add?id='+res.data[i].id+'\')">修改</button>';
						list += '		</div>';
						list += '	</div>';
						list += '</div>';
						list += '<div style="height:2px;background-color:#f5f5f5;margin:10px 0;"></div>';
					}
					page++;
					$("#newList").append(list);
				}else{
					alert(res.errorMsg);
				}
			},'json');
		}
	</script>
{include file="public/tail" /}